void UI_CircleOptions::destroy() {
    PF_SETTINGS->beginGroup("/Draw");
    PF_SETTINGS->writeEntry("/CircleRadius", leRadius->text());
    PF_SETTINGS->endGroup();
}

void UI_CircleOptions::setAction(PF_ActionInterface* a, bool update) {
    if (a!=NULL && a->rtti()==LX_Define::ActionDrawCircleCR) {
        action = (WF_DrawCircleCR*)a;

        QString sr;
        if (update) {
            sr = QString("%1").arg(action->getRadius());
        } else {
            PF_SETTINGS->beginGroup("/Draw");
            sr = PF_SETTINGS->readEntry("/CircleRadius", "1.0");
            PF_SETTINGS->endGroup();
            action->setRadius(sr.toDouble());
        }
        leRadius->setText(sr);
    } else {
        PF_DEBUG->print(PF_Debug::D_ERROR, 
			"UI_CircleOptions::setAction: wrong action type");
        action = NULL;
    }

}


/*void UI_CircleOptions::setData(PF_CircleData* d) {
    data = d;
 
    PF_SETTINGS->beginGroup("/Draw");
    QString r = PF_SETTINGS->readEntry("/CircleRadius", "1.0");
    PF_SETTINGS->endGroup();
 
    leRadius->setText(r);
}*/

void UI_CircleOptions::updateRadius(const QString& r) {
    if (action!=NULL) {
        action->setRadius(PF_Math::eval(r));
    }
}
